import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import F from '../components/FoodList'
import D from '../components/Detail'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      children: [{ // 子路由
        name: 'FoodList',
        path: '/foodlist', // 表示传递的参数params
        component: F,
      }, {
        name: 'Detail',
        path: 'detail',
        component: D,
      }],
    }, 
  ]
})
